Project API
Base URL
/api
All endpoints require authentication using Authorization: Bearer <token>.
Endpoints
GET /project
Retrieve a list of all projects.
Headers:
Authorization: Bearer <token>
Response:
{
"projects": [
{
"id": "string",
"name": "string",
"description": "string",
"created_at": "datetime",
"updated_at": "datetime"
}
]
}
cURL
curl -X 'GET' \
'https://smbrand-be-test.ganapatih.com/api/project?page=1&limit=10' \
-H 'accept: application/json' \
-H 'Authorization: Bearer <token>'
POST /project
Create a new project.
Headers:
Authorization: Bearer <token>
Request Body:
{
"categoryId": "string",
"endDate": "string",
"exclude": "string",
"group": "string",
"keyword": "string",
"startDate": "string",
"type": "string"
}
Response:
{
"message": "string",
"data": {
"id": "string",
"group": "string",
"keyword": "string",
"exclude": "",
"islisten": 0,
"updatedAt": "datetime",
"categoryid": "default",
"start_date": "datetime",
"end_date": "datetime",
"type": "default"
}
}
cURL
curl -X 'POST' \
'https://smbrand-be-test.ganapatih.com/api/project' \
-H 'accept: application/json' \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-d '{
"endDate": "2026-01-01",
"exclude": "",
"group": "string",
"keyword": "string",
"startDate": "2026-01-01",
"type": "default"
}'
DELETE /project
Delete a project.
Headers:
Authorization: Bearer <token>
Request Body:
{
"project_id": "string"
}
Response:
{
"message": "Project deleted successfully"
}
curl -X 'DELETE' \
'https://smbrand-be-test.ganapatih.com/api/project?id={keyword_id}' \
-H 'accept: application/json' \
-H 'Authorization: Bearer <token>'
GET /project/content-count
Retrieve content counts for projects.
Headers:
Authorization: Bearer <token>
Query Parameters:
project_id(optional): ID project spesifik
Response:
{
"total_content": number,
"content_by_project": [
{
"project_id": "string",
"project_name": "string",
"count": number
}
]
}
curl -X 'GET' \
'https://smbrand-be-test.ganapatih.com/api/project/content-count?id={keyword_id}&sosmedId={social_media}' \
-H 'accept: application/json' \
-H 'Authorization: Bearer <token>'
PATCH /project/listen-status
Update the listen status of a project.
Headers:
Authorization: Bearer <token>
Request Body: islisten is for update listening 1 for listening and 0 for stop listening or not listening
{
"project_id": "string",
"islisten": 0
}
Response:
{
"project_id": "string",
"islisten": 0,
"updated_at": "datetime"
}
curl -X 'PATCH' \
'https://smbrand-be-test.ganapatih.com/api/project/listen-status' \
-H 'accept: application/json' \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-d '{
"id": "keyword_id",
"islisten": 0
}'
GET /project/summary/:keywordID
Get a summary based on a keyword ID.
Headers:
Authorization: Bearer <token>
Path Parameters:
keywordID: ID keyword
Response:
{
"id": "string",
"scrapperjobid": "",
"ai_summary": "string",
"sentiment_distribution": "{\"neutral\": number, \"negative\": number, \"positive\": number}",
"created_at": "datetime",
"keyword_id": "string"
}
curl -X 'GET' \
'https://smbrand-be-test.ganapatih.com/api/project/summary/{keyword_id}' \
-H 'accept: application/json' \
-H 'Authorization: Bearer <token>'
POST /project/generate-summary/:keywordID
Generate a new summary for a keyword.
Headers:
Authorization: Bearer <token>
Path Parameters:
keywordID: ID keyword
Response:
{
"status": "success",
"keyword_id": "string",
"result": {
"summary": "string",
"metrics": {
"sentiment_distribution": {
"negative": number,
"neutral": number,
"positive": number
}
}
}
}
curl -X 'POST' \
'https://smbrand-be-test.ganapatih.com/api/project/generate-summary/{keyword_id}' \
-H 'accept: application/json' \
-H 'Authorization: Bearer <token>' \
-d ''
Error Responses
401 Unauthorized
{
"error": "Invalid or missing token"
}
403 Forbidden
{
"error": "Access denied"
}
404 Not Found
{
"error": "Project not found"
}
500 Internal Server Error
{
"error": "Internal server error"
}